<?php
/**
 * DCRM Mobile Page
 *
 * This file is part of WEIPDCRM.
 * 
 * WEIPDCRM is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WEIPDCRM is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with WEIPDCRM.  If not, see <http://www.gnu.org/licenses/>.
 */

require_once('system/common.inc.php');

base_url();

// URL For Rewrite 
$rewrite_mod = get_option('rewrite_mod');
switch($rewrite_mod){
	case 3:
		$rewrite_url = array('public' => 'public/%d','search' => 'search-mfss.html','public_nohistory' => 'public/%d/nohistory', 'screenshot' => 'screenshot/%d', 'history' => 'history/%d', 'contact' => 'contact/%d', 'pcsection' => 'list-%d.html','mipublic' => 'list-pg-%d.html','mipcpage' => 'list-%1$d-pg-%2$d.html', 'report' => 'report/%d', 'report_support' => 'report/%1$d/%2$d', 'more' => 'more/%d', 'more_offset' => 'more/%1$d/%2$d', 'misc' => 'misc','down' => 'downloads.html');
		break;
	case 1:
	case 2:
	default:
		$rewrite_url = array('view' => 'index.php?method=view&amp;pid=%d', 'view_nohistory' => 'index.php?pid=%d&amp;addr=nohistory', 'screenshot' => 'index.php?method=screenshot&amp;pid=%d', 'history' => 'index.php?method=history&amp;pid=%d', 'contact' => 'index.php?method=contact&amp;pid=%d', 'section' => 'index.php?method=section&amp;pid=%d', 'report' => 'index.php?method=report&amp;pid=%d', 'report_support' => 'index.php?method=report&amp;pid=%1$d&amp;support=%2$d', 'more' => 'index.php?method=more&amp;pid=%d', 'more_offset' => 'index.php?method=more&amp;pid=%1$d&amp;offset=%2$d', 'misc' => 'misc.php');
		break;
}
function echo_rewrite_url($type, $variable1, $variable2=''){
	global $rewrite_url;
	echo SITE_URL;
	printf($rewrite_url[$type], $variable1, $variable2);
}

class_loader('Mobile_Detect');
$detect = new Mobile_Detect;
if(!$detect->isiOS()){
	if (DCRM_PCINDEX == 1) {
		header("Location: ".SITE_URL.$rewrite_url['misc']);
		exit();
	} else {
		$isCydia = false;
	}
} else {
	if (DCRM_MOBILE == 2) {
		if (!strpos($detect->getUserAgent(), 'Cydia')) {
			$isCydia = false;
		} else {
			$isCydia = true;
		}
	} else {
		exit('Access Denied');
	}
}
if (file_exists('Release')) {
	$release = file('Release');
	$release_origin = __('No Name');
	$release_mtime = filemtime('Release');
	$release_time = date('Y-m-d H:i:s',$release_mtime);
	foreach ($release as $line) {
		if(preg_match('#^Origin#', $line)) {
			$release_origin = trim(preg_replace("#^(.+):\\s*(.+)#","$2", $line));
		}
		if(preg_match("#^Description#", $line)) {
			$release_description = trim(preg_replace("#^(.+):\\s*(.+)#","$2", $line));
		}
	}
} else {
	$release_origin = __('Empty Page');
}
if (isset($_GET['pid'])) {
	if (ctype_digit($_GET['pid']) && intval($_GET['pid']) <= 10000) {
		function device_check(){
			global $detect;
			$device_type = array('iPhone', 'iPod', 'iPad');
			for ($i = 0; $i < count($device_type); $i++) {
				$check = $detect->version($device_type[$i]);
				if ($check !== false) {
					if (isset($_SERVER['HTTP_X_MACHINE'])) {
						$DEVICE = $_SERVER['HTTP_X_MACHINE'];
					} else {
						$DEVICE = 'Unknown';
					}
					$OS = str_replace('_', '.', $check);
					break;
				}
			}
			return array('DEVICE' => $DEVICE, 'OS' => $OS);
		}

		if (isset($_GET['method']) && $_GET['method'] == 'screenshot') {
			$index = 2;
			$title = __('View Screenshots');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'report') {
			$device_info = device_check();
			if (!isset($_GET['support'])) {
				$index = 3;
			} else {
				if ($_GET['support'] == '1') {
					$support = 1;
				} elseif ($_GET['support'] == '2') {
					$support = 2;
				} elseif ($_GET['support'] == '3') {
					$support = 3;
				} else {
					$support = 0;
				}
				$index = 4;
			}
			$title = __('Report Problems');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'history') {
			$index = 5;
			$title = __('Version History');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'contact') {
			$index = 6;
			$title = __('Contact us');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'pcsection') {
			$index = 7;
          $section = DB::fetch_first("SELECT `Name`, `Icon` FROM `".DCRM_CON_PREFIX."Sections` WHERE `ID` = '".(int)$_GET['pid']."'");
			$title = __(DB::real_escape_string($section['Name']));
		} elseif (isset($_GET['method']) && $_GET['method'] == 'more') {
			$index = 8;
			$section = DB::fetch_first("SELECT `Name`, `Icon` FROM `".DCRM_CON_PREFIX."Sections` WHERE `ID` = '".(int)$_GET['pid']."'");
			$q_name = DB::real_escape_string($section['Name']);
			if (isset($_GET['offset']) && !empty($_GET['offset']) && ctype_digit($_GET['offset'])) {
				$offset = intval($_GET['offset']);
			} else {
				$offset = 0;
			}
			$packages = DB::fetch_all("SELECT `ID`, `Name`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Section` = '".$q_name."') ORDER BY `ID` DESC LIMIT 10 OFFSET ".$offset);
			foreach($packages as $package){
				if(!empty($package)){
					if ($isCydia) { ?>
				<a href="cydia://package/<?php echo($package['Package']); ?>" target="_blank">
<?php					} else { ?>
				<li>
	<a href="<?php echo_rewrite_url('pc', $package['ID']);?>" class="app_icon" >
<?php					} ?>
	
    
<div class="desc" ><?php echo ($package['Description']);  ?></div>
</li>
<?php
				}
			}
			exit();
		} elseif (!isset($_GET['method']) || (isset($_GET['method']) && $_GET['method'] == 'public')) {
			$index = 1;
			$title = __('View Package');
			$package_id = (int)DB::real_escape_string($_GET['pid']);
			$package_info = DB::fetch_first("SELECT `Name`, `Version`, `Author`, `Package`, `Description`, `DownloadTimes`, `Multi`, `CreateStamp`, `Size`, `Installed-Size`,`SectionID`, `Section`, `Homepage`, `Tag`, `Level`, `Price`, `Purchase_Link`, `Changelog`, `Changelog_Older_Shows`, `Video_Preview`, `System_Support`, `ScreenShots` FROM `".DCRM_CON_PREFIX."Packages` WHERE `ID` = '".$package_id."' LIMIT 1");
			if ($package_info) $title = $package_info['Name'];
		} else {
			httpinfo(405);
			exit();
		}
	} else {
		httpinfo(405);
		exit();
	}
} elseif (!isset($_GET['method'])) {
	$index = 0;
	$title = $release_origin;
} else {
	httpinfo(405);
	exit();
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title><?php echo($title); ?> | 最简洁的中文源</title>
		<meta charset="utf-8">
		<meta name="robots" content="index, follow" />
      <mobile:mobile type="pc,mobile"/>
      <meta name="description" content="<?php echo(AUTOFILL_KEYWORDS); ?>" />
<?php
if (defined("AUTOFILL_SEO")) {
?>
		<meta name="title" content="<?php echo(AUTOFILL_SEO); ?>" />
<?php
}
if (!empty($release_description)) {
?>
		<meta name="description" content="<?php echo($release_description); ?>" />
<?php
}
if (defined("AUTOFILL_KEYWORDS")) {
?>
		<meta name ="keywords" content="<?php echo(AUTOFILL_KEYWORDS); ?>" />
<?php
}
if ($isCydia) {
?>
		<base target="_blank">
<?php
} else {
?>
		<base target="_top">
<?php
}
?>
<link rel="apple-touch-icon" href="<?php echo(SITE_URL); ?>CydiaIcon.png">
<link rel="shortcut icon" href="<?php echo(SITE_URL); ?>favicon.ico">
<link rel="stylesheet" type="text/css" href="<?php echo(SITE_URL); ?>ziyuan/css/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo(SITE_URL); ?>ziyuan/css/list.css" />
<link rel="stylesheet" type="text/css" href="<?php echo(SITE_URL); ?>ziyuan/css/rank.css" />
<!--script type="text/javascript" src="https:<?php echo(SITE_URL); ?>baohu.js"></script-->
<link rel="stylesheet" href="ziyuan/js/swiper.min.css">
<script src="ziyuan/js/swiper.min.js"></script>
<script type="text/javascript" src="<?php echo(SITE_URL); ?>ziyuan/js/postbird-img-glass.js" ></script>
      

	</head>
	<body class="pinstripe">
		<panel>
			 <!-- Global Topbar -->
    <div class="global_topbar_wrap">
		<div id="global_topbar" class="global_topbar">
			<div class="wrap inner">
                    
<?php                                                                 
    if (defined("AUTOFILL_PCDBZDYMC1") or defined("AUTOFILL_PCDBZDY1") or defined("AUTOFILL_ZTMHDZ1") or defined("AUTOFILL_ZTMHDZMC1") or defined("AUTOFILL_YYWXZQ1") or defined("AUTOFILL_YYWXZQMC1") or defined("AUTOFILL_YYZJBB1") or defined("AUTOFILL_YYZJBBMC1") or defined("AUTOFILL_WLPJHZ1") or defined("AUTOFILL_WLPJHZMC1")) {
?>              
				<div class="services" id="global_topbar_services">
					<ul>
<?php
                                                                   
    if (defined("AUTOFILL_PCDBZDY1") && defined("AUTOFILL_PCDBZDYMC1")) {
?>                        
                    <li class="current"><a href="<?php echo(AUTOFILL_PCDBZDY1); ?>"><i class="weiphone"></i><?php echo(AUTOFILL_PCDBZDYMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_ZTMHDZ1") && defined("AUTOFILL_ZTMHDZMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_ZTMHDZ1); ?>" target="_blank"><i class="wegame"></i><?php echo(AUTOFILL_ZTMHDZMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_YYZJBB1") && defined("AUTOFILL_YYZJBBMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_YYZJBB1); ?>" target="_blank"><i class="fengbuy"></i><?php echo(AUTOFILL_YYZJBBMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_WLPJHZ1") && defined("AUTOFILL_WLPJHZMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_WLPJHZ1); ?>" target="_blank"><i class="wper"></i><?php echo(AUTOFILL_WLPJHZMC1); ?></a></li>
<?php
    }                                                                     
    if (defined("AUTOFILL_YYWXZQ1") && defined("AUTOFILL_YYWXZQMC1")) {
?>                       
						<li><a href="<?php echo(AUTOFILL_YYWXZQ1); ?>" ><i class="weand"></i><?php echo(AUTOFILL_YYWXZQMC1); ?></a></li>
                     
<?php
	}
?>						
                     
					</ul>
					<a href="javascript:;" class="expand"><span>展开</span></a>
				</div>               
<?php
	}
?>	              
				<div class="links" id="globar_topbar_links">
					<ul>
						<li><a href="<?php echo(SITE_URL); ?>" target="_blank">首页</a></li>
<?php
	if (defined("AUTOFILL_PCDBZDY") && defined("AUTOFILL_PCDBZDY_NAME")) {
?>              
			<li><a href="<?php echo(AUTOFILL_PCDBZDY); ?>" target="_blank"><?php echo(AUTOFILL_PCDBZDY_NAME); ?></a></li> 
<?php
	}
?> 
					</ul>
					<div class="focus"><em></em></div>
				</div>
                <div class="user_menu">
				<ul>
<?php
require_once 'qqlogin/function.php';
require_once 'qqlogin/Connect2.1/qqConnectAPI.php';	
?>                  
<?php if(!isset($_SESSION["accesstoken"]) || !isset($_SESSION["openid"])) { ?>
		<li><a href="<?php echo(SITE_URL); ?>qqlogin/qqlogin.php">登录</a></li>        
<?php } else { 
    $qc = new QC($_SESSION["accesstoken"],$_SESSION["openid"]);
    $arr = $qc->get_user_info();           
?>  
                <li><img class="icon" src="<?php echo $arr['figureurl_qq_2'];?>" style="border-radius: 50%; width: 20px; height: 20px; box-shadow:0 0 1px #AAA;padding:1px;margin-right: 1px;"></li> 
                <li>用户名：<?php echo $arr['nickname'];?></li>  
				<li><a href="<?php echo(SITE_URL); ?>User.php" target="_blank">个人中心</a></li>
                <li><a onclick="cookipost()" >退出登录</a></li>  
 <script language="javascript">
    function cookipost(){
      $.get("<?php echo(SITE_URL); ?>qqlogin/qqlogout.php", function(result){
        alert('账户退出');
    	window.location.href='<?php echo(SITE_URL); ?>';
  	  });  
	}
</script>                  
<?php
}
?> 
                  
      
 <?php 
if(isset($_SESSION["accesstoken"]) || isset($_SESSION["openid"])) {      
$User=$arr["nickname"];
$Logo=$arr['figureurl_qq_2'];
$Openid=$_SESSION["openid"];
$date=date("Y-m-d h:i:s");
$ip = ($ip) ? $ip : $_SERVER["REMOTE_ADDR"];   
if($row=DB::result_first("SELECT * FROM `".DCRM_CON_PREFIX."User` WHERE `Openid`='".$Openid."'" )){    
  $sql = DB::query("UPDATE `".DCRM_CON_PREFIX."User` SET `Logo` = '".$Logo."', `User` = '".$User."',`IP` = '".$ip."' WHERE `Openid`='".$Openid."'");
} else {  
  $query = DB::query("INSERT INTO `".DCRM_CON_PREFIX."User` (ID,User,Logo,Openid,Packages,Collection,TimeStamp,IP) VALUES ('','$User','$Logo','$Openid','','','$date','$ip')");
}      
}
?> 
                 
				</ul>
			    </div>
			</div>
		</div>
	</div> 
<!-- Header -->
<div class="header_wrap">
	<div id="header" class="header">
		<div class="wrap_con header_inner">
			<h2><a href="<?php echo(SITE_URL); ?>"><?php echo(AUTOFILL_SEO); ?></a></h2>
			<div class="navigator">
				<ul>
					<li >
						<a href="<?php echo(SITE_URL); ?>">
							<i class="home"></i><span>首页</span>
						</a>
					</li>
					<li >
						<a href="<?php echo(SITE_URL); ?>public.html">
							<i class="list"></i><span>资源列表</span>
						</a>
					</li>
<?php
	if (defined("AUTOFILL_PCZDYDH") && defined("AUTOFILL_PCZDYDH_NAME")) {
?>                   
					<li >
						<a href="<?php echo(AUTOFILL_PCZDYDH); ?>">
							<i class="rank"></i><span><?php echo(AUTOFILL_PCZDYDH_NAME); ?></span>
						</a>
					</li>
<?php
    }                                                                     
    if (defined("AUTOFILL_PCZDYDH2") && defined("AUTOFILL_PCZDYDH2_NAME")) {
?>                   
					<li >
					     <a href="<?php echo(AUTOFILL_PCZDYDH2); ?>" >
						<i class="me"></i><span><?php echo(AUTOFILL_PCZDYDH2_NAME); ?></span>
                         </a>
					</li>
                           
<?php
    }                                                                     
?>   
				</ul>
			</div>
		</div>
	</div>
</div>          
<?php
$repo_url = base64_decode(DCRM_REPOURL);
if ($index == 0) {
	if (!$isCydia) {
?>

<!-- 变化开始 -->
<!-- main4 -->
<!--资源列表-->
<div class="resource_list clearfix">
	<div class="wrap_con">
		<h1>资源列表</h1>
		<div class="platform">
			<a href="" class="current">
			<em class="iphone" title="iPhone">iPhone</em> 
			<em class="ipad" title="iPad">iPad</em></a>
			<a href="" >
			<em class="iphone" title="iPhone">iPhone</em></a>
			<a href="" >
			<em class="ipad" title="iPad">iPad</em></a>
		</div>
      <!--列表内容展示-->
<div class="search_box">
				<form action="search.php" method="get" >	
					<span class="txt">
						<input class="input" type="text" name="name"  placeholder="搜索你想要的" required="required" />
					</span>
					<span class="btn"><button type="submit" id="search_btn"><i></i>搜索</button></span>
				</form>
			</div>
	</div>
</div>
<?php
	}
?>
      <div class="resource_con clearfix">
	<div class="wrap_con">
		<div class="classify clearfix">				
			<div class="type_box bule_line">
				<div class="rank_sort">分类列表</div>
				<div class="soft_link">
					<a href="<?php echo(SITE_URL); ?>public.html" class="current" >全部分类</a>

<?php
		$sections = DB::fetch_all("SELECT `ID`, `Name`, `Icon` FROM `".DCRM_CON_PREFIX."Sections`");
		foreach($sections as $section){
?> 
		<a href="<?php echo_rewrite_url('pcsection', $section['ID']); ?>">[<?php echo($section['Name']); ?>]</a>
<?php
		}
?>
			
                  
</div>			
</div>                 
<?php
	$num = DB::result_first("SELECT count(*) FROM `".DCRM_CON_PREFIX."Packages` WHERE `Stat` = '1'");
?>
<?php
	$down = DB::result_first("SELECT SUM(`DownloadTimes`)FROM `".DCRM_CON_PREFIX."Packages` WHERE `Stat` = '1'");
?>
			<div class="type_box green_line">
				<div class="rank_sort">资源排序</div>
				<div class="soft_link">
				<a href="<?php echo(SITE_URL); ?>public.html" class="current" >最新上传</a>
                 <a href="<?php echo(SITE_URL); ?>downloads.html" class="current" >最多下载</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOS9.html" class="current" >IOS9分类</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOS10.html" class="current" >IOS10分类</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOS11.html" class="current" >IOS11分类</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOSClass.html" class="current" >IOS应用分类</a>
			</div>
            </div>
            <div class="type_box orage_line">
			     <div class="rank_sort">更新时间</div>
			     <div class="soft_link">
			     <a href="<?php echo(SITE_URL); ?>public.html"  >不限</a>
				 <a href="<?php echo(SITE_URL); ?>public-ThreeDay.html"  >三天内</a>
				 <a href="<?php echo(SITE_URL); ?>public-SevenDay.html"  >一周内</a>
				 <a href="<?php echo(SITE_URL); ?>public-OneMonth.html"  >一个月内</a>
				 <a href="<?php echo(SITE_URL); ?>public-Halfyear.html"  >半年内</a>
			</div>  
			</div>
				<div class="type_box red_line">
				<div class="rank_sort">资源总量</div>
				<div class="soft_link">
				<a class="current" >本源有效资源共有<?php printf( $num ); ?> 个软件包<br>全源软件包下载量总计 <?php printf( $down ); ?>次 </a>  
			</div>
		</div>
</div>

<div id="app_list" class="app_list">
<ul class="clearfix">	            



  
 <?php 
function news($pageNum = 1, $pageSize = 9)
{
    $array = array();
    $coon = mysqli_connect("localhost", "s7420423", "kui203061");
    mysqli_select_db($coon, "s7420423");
    mysqli_set_charset($coon, "utf8");
    // limit为约束显示多少条信息，后面有两个参数，第一个为从第几个开始，第二个为长度
    $rs = "select `ID`, `Name`,`Icon2`, `Section`, `SectionID`,  `Description`,`DownloadTimes`,`Package` from `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1') ORDER BY `CreateStamp` DESC limit " . (($pageNum - 1) * $pageSize) . "," . $pageSize;
    $r = mysqli_query($coon, $rs);
    while ($obj = mysqli_fetch_object($r)) {
        $array[] = $obj;
    }

    return $array;
}
  function allNews()
{
    $coon = mysqli_connect("localhost", "s7420423", "kui203061");
    mysqli_select_db($coon, "s7420423");
    mysqli_set_charset($coon, "utf8");
    $rs = "select count(*) num from `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1') ORDER BY `CreateStamp`"; //可以显示出总页数
    $r = mysqli_query($coon, $rs);
    $obj = mysqli_fetch_object($r);

    return $obj->num;
}
?> 
<?php
   $allNum = allNews();
   $pageSize = 9; //约定每页显示的信息条数
   $pageNum = empty($_GET["pageNum"])?1:$_GET["pageNum"];
   $endPage = ceil($allNum/$pageSize); //总页数
   $array = news($pageNum,$pageSize);
?>  
<div id="app_list" class="app_list">
<ul class="clearfix">			

<?php  
    foreach($array as $key=>$values){  
?>
  	<li>
	<a href="<?php echo_rewrite_url('public', $values->ID);?>" class="app_icon" >     
      <img class="icon" src="<?php echo(SITE_URL); ?>icon/<?php echo($values->Icon2); ?>" height="118" width="118" alt="图标图片"/ >
	  <img src="<?php echo(SITE_URL); ?>ziyuan/picture/<?php echo($values->Icon2); ?>.jpg" height="118" width="118" class="bg" alt="背景图片" />
		<em class="add" ></em><i class="mask"></i><i class="tag"><em class="deb">deb</em></i>
	</a>
	<a href="<?php echo_rewrite_url('public', $values->ID);?>" class="tit" ><p><?php echo($values->Name); ?></p></a>
	<span class="type"><a href="<?php echo_rewrite_url('pcsection', $values->SectionID);?>" >[ <?php echo($values->Section); ?> ]</a></span>
      
		<div class="props">
		<span class="platform">
		<em class="iphone" title="iPhone">iPhone</em>
		<em class="ipad" title="iPad">iPad</em>
	</span>
<?php
	$numsc = DB::result_first("SELECT count(*) FROM `".DCRM_CON_PREFIX."Collection` WHERE `Package`='".$values->Package."'");
?> 
 <span class="count">下载次数<em><?php echo($values->DownloadTimes); ?></em>次</span><span class="pipe">/</span><span class="count">收藏次数<em><?php echo($numsc); ?></em>次</span>
</div>      
<div class="desc" ><?php echo($values->Description); ?></div>
</li>
<?php
       } 
?>

<li class="fix"></li>
</ul>
<div class="pager">
<div class="page_list">
<div class="pagin">   
<a href="<?php echo_rewrite_url('mipublic', '1');?>">首页</a>  
<a href="<?php echo_rewrite_url('mipublic', $pageNum==1?1:($pageNum-1));?>">上一页</a> 
<span class='current'><?php echo $pageNum ?>/<?php echo ($endPage)?></span>
<a href="<?php echo_rewrite_url('mipublic', $pageNum==$endPage?$endPage:($pageNum+1));?>">下一页</a>
<a href="<?php echo_rewrite_url('mipublic', $endPage);?>">尾页</a>
</div></div></div>
 </div>  </div> 

<br>
</div>  
</div> 
        
        
        
 <!-- 分类页-->        
 <?php
		}
elseif ($index == 7) {

?>

<!-- 变化开始 -->
<!-- main4 -->
<!--资源列表-->
        	<?php $color = array(4 => '#4876FF', 5 => '#FFD700', 6 => '#FFA500', 7 => '#EE7621', 8 => '#9ACD32', 9 => '#1E90FF', 10 => '#FF0000	', 11 => '#FF0000', 12 => '#1E90FF', 13 => '#EE7621');	?> 		
<div class="resource_list clearfix">
	<div class="wrap_con">
		<h1 style="color: <?php echo($color[(int)$_GET['pid']]); ?>" ><?php echo($title); ?></h1>
		<div class="platform">
			<a href="" class="current">
			<em class="iphone" title="iPhone">iPhone</em> 
			<em class="ipad" title="iPad">iPad</em></a>
			<a href="" >
			<em class="iphone" title="iPhone">iPhone</em></a>
			<a href="" >
			<em class="ipad" title="iPad">iPad</em></a>
		</div>
      <!--列表内容展示-->
<div class="search_box">
				<form action="search.php" method="get" >	
					<span class="txt">
						<input class="input" type="text" name="name"  placeholder="搜索你想要的" required="required" />
					</span>
					<span class="btn"><button type="submit" id="search_btn"><i></i>搜索</button></span>
				</form>
			</div>
	</div>
</div>

      <div class="resource_con clearfix">
	<div class="wrap_con">
		<div class="classify clearfix">				
			<div class="type_box bule_line">
				<div class="rank_sort">分类列表</div>
				<div class="soft_link">

 <a href="<?php echo(SITE_URL); ?>public.html" ><p style="color: <?php echo($color[(int)$_GET['pid']]); ?>" >全部分类</p></a>
<?php

		$sections = DB::fetch_all("SELECT `ID`, `Name`, `Icon` FROM `".DCRM_CON_PREFIX."Sections`");
		foreach($sections as $section){
?> 
                 
		<a href="<?php echo_rewrite_url('pcsection', $section['ID']); ?>"><p style="color: <?php echo($color[(int)$_GET['pid']]); ?>" >[<?php echo($section['Name']); ?>]</p></a>
       
<?php
		}
?>
			
                  
</div>			
</div>  
 <?php         
	if (DCRM_ALLOW_FULLLIST == 2) {
		$sections = DB::fetch_first("SELECT `Name`, `Icon`, `TimeStamp` FROM `".DCRM_CON_PREFIX."Sections` WHERE `ID` = '".(int)$_GET['pid']."'");
		if (!$sections) {
?>
			<block>
				<p>
					<?php _e('Invalid section!<br />Perhaps this section has been deleted by us.'); ?>
				</p>
			</block>
<?php
		} else {
          
?>

<?php
				$s_num = DB::result_first(DB::prepare("SELECT count(*) FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Section` = '%s')", $sections['Name']));
?>
<?php
          
	$down = DB::result_first(DB::prepare("SELECT SUM(`DownloadTimes`) FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Section` = '%s')", $sections['Name']));
?>
			<div class="type_box green_line">
				<div class="rank_sort">资源排序</div>
				<div class="soft_link">
				<a href="<?php echo(SITE_URL); ?>public.html" class="current" >最新上传</a>
                 <a href="<?php echo(SITE_URL); ?>downloads.html" class="current" >最多下载</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOS9.html" class="current" >IOS9分类</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOS10.html" class="current" >IOS10分类</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOS11.html" class="current" >IOS11分类</a>
                <a href="<?php echo(SITE_URL); ?>public-list-iOSClass.html" class="current" >IOS应用分类</a>
			</div>
            </div>
            <div class="type_box orage_line">
			     <div class="rank_sort">更新时间</div>
			     <div class="soft_link">
			     <a href="<?php echo(SITE_URL); ?>public.html"  >不限</a>
				 <a href="<?php echo(SITE_URL); ?>public-ThreeDay.html"  >三天内</a>
				 <a href="<?php echo(SITE_URL); ?>public-SevenDay.html"  >一周内</a>
				 <a href="<?php echo(SITE_URL); ?>public-OneMonth.html"  >一个月内</a>
				 <a href="<?php echo(SITE_URL); ?>public-Halfyear.html"  >半年内</a>
			</div>  
			</div>
				<div class="type_box red_line">
				<div class="rank_sort">分类总量</div>
				<div class="soft_link">
				<a class="current" ><?php echo($sections['Name']); ?>分类共有<?php printf( $s_num ); ?> 个软件包<br><?php echo($title); ?>分类软件包下载量总计 <?php printf( $down ); ?>次 </a> 
			</div>
		</div>
</div>
<?php
       }}
?>	            
<?php 
function news($CydiaPage = 1, $pageSize = 9)
{
    $array = array();
    $coon = mysqli_connect("localhost", "s7420423", "kui203061");
    mysqli_select_db($coon, "s7420423");
    mysqli_set_charset($coon, "utf8");
    // limit为约束显示多少条信息，后面有两个参数，第一个为从第几个开始，第二个为长度
    $rs = "select `ID`,`Name`,`Icon2`, `Section`, `SectionID`,  `Description`,`DownloadTimes` from apt_Packages WHERE (`Stat` = '1' and `SectionID`= '".(int)$_GET['pid']."') ORDER BY `CreateStamp` DESC limit " . (($CydiaPage - 1) * $pageSize) . "," . $pageSize;
    $r = mysqli_query($coon, $rs);
    while ($obj = mysqli_fetch_object($r)) {
        $array[] = $obj;
    }

    return $array;
}

function allNews()
{
    $coon = mysqli_connect("localhost", "s7420423", "kui203061");
    mysqli_select_db($coon, "s7420423");
    mysqli_set_charset($coon, "utf8");
    $rs = "SELECT count(*) num FROM apt_Packages WHERE `Stat` = '1' and `SectionID`= '".(int)$_GET['pid']."'"; //可以显示出总页数    
    $r = mysqli_query($coon, $rs);
    $obj = mysqli_fetch_object($r);

    return $obj->num;
}

   @$allNum = allNews();
   @$pageSize = 9; //约定每页显示的信息条数
   @$CydiaPage = empty($_GET["CydiaPage"])?1:$_GET["CydiaPage"];
   @$endPage = ceil($allNum/$pageSize); //总页数
   @$array = news($CydiaPage,$pageSize);
   @$url1 = SITE_URL;
?> 
	 
<div id="app_list" class="app_list">
<ul class="clearfix">			
<?php  
    foreach($array as $key=>$values){  
?>
  	<li>
	<a href="<?php echo_rewrite_url('public', $values->ID);?>" class="app_icon" >     
      <img class="icon" src="<?php echo(SITE_URL); ?>icon/<?php echo($values->Icon2); ?>" height="118" width="118" alt="图标图片"/ >
	  <img src="<?php echo(SITE_URL); ?>ziyuan/picture/<?php echo($values->Icon2); ?>.jpg" height="118" width="118" class="bg" alt="背景图片" />
		<em class="add" ></em><i class="mask"></i><i class="tag"><em class="deb">deb</em></i>
	</a>
	<a href="<?php echo_rewrite_url('public', $values->ID);?>" class="tit" ><p><?php echo($values->Name); ?></p></a>
	<span class="type"><a href="<?php echo_rewrite_url('pcsection', $values->SectionID);?>" >[ <?php echo($values->Section); ?> ]</a></span>
		<div class="props">
		<span class="platform">
		<em class="iphone" title="iPhone">iPhone</em>
		<em class="ipad" title="iPad">iPad</em>
	</span>
<?php
	$numsc = DB::result_first("SELECT count(*) FROM `".DCRM_CON_PREFIX."Collection` WHERE `Package`='".$values->Package."'");
?> 
 <span class="count">下载次数<em><?php echo($values->DownloadTimes); ?></em>次</span><span class="pipe">/</span><span class="count">收藏次数<em><?php echo($numsc); ?></em>次</span>
</div>      
<div class="desc" ><?php echo($values->Description); ?></div>
</li>
<?php
       } 
?>

<li class="fix"></li>
</ul>
<div class="pager">
<div class="page_list">
<div class="pagin">   
<a href="<?php echo_rewrite_url('mipcpage',$values->SectionID , '1');?>">首页</a>  
<a href="<?php echo_rewrite_url('mipcpage',$values->SectionID , $CydiaPage==1?1:($CydiaPage-1));?>">上一页</a> 
<span class='current'><?php echo $CydiaPage ?>/<?php echo ($endPage)?></span>
<a href="<?php echo_rewrite_url('mipcpage',$values->SectionID , $CydiaPage==$endPage?$endPage:($CydiaPage+1));?>">下一页</a>
<a href="<?php echo_rewrite_url('mipcpage',$values->SectionID , $endPage);?>">尾页</a>
</div></div></div>
 </div>  </div>          
<?php	
} elseif ($index == 1) {
	if (!$package_info) {
?>
			<block>
				<p>
					<?php _e('Invalid package!<br />Perhaps this package has been deleted by us.'); ?>
				</p>
			</block>
<?php
	} else {
		if (!$isCydia) {
?>

<?php
$packages = DB::fetch_all("SELECT count(*) `ID`, `DownloadTimes`, `Changelog`, `Multi`,`Description`, `Version`, `Installed-Size`, `Section`, `Name`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE  (`Stat` = '1' AND `Section` = '".DB::real_escape_string($section['Name'])."') ");
				foreach($packages as $package) {
?>
			 <!-- Global Topbar -->

      
<?php
	$num = DB::result_first("SELECT count(*) FROM `".DCRM_CON_PREFIX."Packages` WHERE `Stat` = '1'");
?> 

  <?php
			if (!empty($package_info['Section'])) {
				$section_icon = DB::result_first("SELECT `Icon`,`ID` FROM `".DCRM_CON_PREFIX."Sections` WHERE `Name` = '".$package_info['Section']."' LIMIT 1");
              
			}
?>
<?php
$package_id = (int)DB::real_escape_string($_GET['pid']);
?>
<!--script type="text/javascript">
    try {
        var urlhash = window.location.hash;
        if (!urlhash.match("fromapp")) {
            if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))) {
                window.location = "<?php echo(SITE_URL); ?>view/<?php echo((int)DB::real_escape_string($_GET['pid'])); ?>";
            }
        }
    } 
    catch (err) {
    }
</script-->
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<div id="read_info" class="clearfix read_info" style="background-image:url('<?php echo(SITE_URL); ?>ziyuan/picture/<?php echo(empty($section_icon) ? 'default/unknown.png' : $section_icon); ?>.jpg')">
		<div class="wrap_con">
		<div class="type_name"><a href="<?php echo(SITE_URL); ?>public.html" >资源列表</a><span class="pipe">/</span><a href="<?php echo_rewrite_url('pcsection', $package_info['SectionID']);?>" class="current">[<?php echo($package_info['Section']); ?> ]</a></div>
		<div class="soft_abs">
		<div class="soft_img"><img src="<?php echo(SITE_URL); ?>icon/<?php echo(empty($section_icon) ? 'default/unknown.png' : $section_icon); ?>" width="118" height="118" alt="背景图片"/></div>	       
        <div class="originbtn_btn">
 <?php if(!isset($_SESSION["accesstoken"]) || !isset($_SESSION["openid"])) { ?>          
		<a class="add_originbtn" href="/qqlogin/qqlogin.php" target= "_blank" ><i></i><span>您未登录账号</span></a>
  <?php }?>
<?php  
if(isset($_SESSION["accesstoken"]) || isset($_SESSION["openid"])) {                  
if($row=DB::result_first("SELECT `ID`,`UserOpenID`,`Package`,`Name`,`Icon`,`TimeStamp` FROM `".DCRM_CON_PREFIX."Collection` WHERE `UserOpenID`='".$_SESSION["openid"]."' AND `Package`='".$package_info['Package']."'" )){
 ?>
<a class="add_originbtn" onclick="bookmark()"  id="add_originbtn"><i></i><span>已收藏</span></a>  
<script type="text/javascript">
function bookmark() {
$.ajax({
type: "get",//定义提交的方法，post或
url: '<?php echo(SITE_URL); ?>qqlogin/favourite.php?UserOpenID2=<?php echo($_SESSION["openid"]); ?>&Package=<?php echo($package_info['Package']); ?>&PackageID=<?php echo($package_id); ?>&Name=<?php echo($package_info['Name']); ?>&Icon=<?php echo($section_icon); ?>',
success: function(msg){
alert('取消收藏');
location=location
}
});
    }
</script>          
<?php }else{?> 
<a class="add_originbtn" onclick="bookmark()" id="add_originbtn"><i></i><span>未收藏</span></a>      	
<script type="text/javascript">
function bookmark() {
$.ajax({
type: "get",//定义提交的方法，post或
url: '<?php echo(SITE_URL); ?>qqlogin/favourite.php?UserOpenID=<?php echo($_SESSION["openid"]); ?>&Package=<?php echo($package_info['Package']); ?>&PackageID=<?php echo($package_id); ?>&Name=<?php echo($package_info['Name']); ?>&Icon=<?php echo($section_icon); ?>',
success: function(msg){
alert('收藏成功');
location=location
}
});
}
</script>          
<?php }}?>          
</div>



		<table cellpadding="0" cellspacing="0">
				<tbody>
					<tr>
						<td colspan="3"><h2 id="resource_name" ><?php echo($package_info['Name']); ?></h2></td>
					</tr>
					<tr>
						<td>软件版本：<?php echo($package_info['Version']); ?></td>
						<td>支持设备：<span class="platform">
							<em class="iphone" title="iPhone">iPhone</em>
							<em class="ipad" title="iPad">iPad</em>
							</span>
						</td>
					</tr>
					<tr>
<?php
		if (!empty($package_info['System_Support'])){
			$system_support = unserialize($package_info['System_Support']);
				}
?>
						<td>文件大小：<?php echo(sizeext($package_info['Size'])); ?></td>
						<td>支持版本：iOS <?php echo($system_support['Minimum']); if($system_support['Maxmum']): ?> ~ iOS <?php echo($system_support['Maxmum']); endif; ?></td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td>提供者：<?php echo(AUTOFILL_SEO); ?></td>
						<td>下载次数：<em><?php echo($package_info['DownloadTimes']); ?></em>次</td>
						<td>&nbsp;</td>
					</tr>
				</tbody>
			</table>
		</div>
        
		<!--个人信息-->
<!--SEO推送收录开始--> 
<?php
$package_id = (int)DB::real_escape_string($_GET['pid']);
?>              
<?php   
                                
$urls = array(
  'http://mycydia.vip/public/'.$package_id.''
  );
$api = 'http://data.zz.baidu.com/urls?appid=1617032924050561&token=w58MAEcJ3X1liKQO&type=realtime';
$ch = curl_init();
$options =  array(
    CURLOPT_URL => $api,
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => implode("\n", $urls),
    CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch); 
//echo $result;
?> 
<?php               
  $urls = array(
   'http://mycydia.vip/public/'.$package_id.''
  );
$api = 'http://data.zz.baidu.com/urls?appid=1617032924050561&token=w58MAEcJ3X1liKQO&type=batch';
$ch = curl_init();
$options =  array(
    CURLOPT_URL => $api,
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => implode("\n", $urls),
    CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
//echo $result;                     
?>                        
 <!--SEO推送收录结束-->               
		<div class="personal_mod">
			<div class="user_box">
				<a href="http://mycydia.vip" ><img src="<?php echo(SITE_URL); ?>CydiaIcon.png"  height="92" width="92" alt="LOGO"/></a>
			</div>
			<p class="name" ><a href="<?php echo(SITE_URL); ?>" style="color: #c0392b;" target="_blank"><?php echo(AUTOFILL_SEO); ?></a><span class="medial" title="<?php echo(AUTOFILL_SEO); ?>组织认证"></span>
</p>
			<p class="web_link"><a href="<?php echo(SITE_URL); ?>" style="color: #c0392b;" target="_blank">https:<?php echo(SITE_URL); ?></a></p>
			<div class="statistics">
				<div class="tit">
				<em><?php printf( $num ); ?></em>
					<p>资源</p>
				</div>
<?php
				$snum = DB::result_first("SELECT SUM(DownloadTimes) FROM `".DCRM_CON_PREFIX."Packages`");
?>
				<div class="tit">
					<a  style="color: #c0392b;" ><i><?php echo round(($snum+(AUTOFILL_FENSI_YEAR))/10/10*2); ?></i>
					<p>粉丝</p></a>
				</div>
				<div class="tit" style="color: #c0392b;" >
					<a  style="color: #c0392b;" ><i><?php echo round(($snum+(AUTOFILL_RENQI_YEAR))/15); ?></i>
					<p>人气</p></a>
				</div>
			</div>
<?php
$package_id = (int)DB::real_escape_string($_GET['pid']);
?>
			<div class="see_btn"><a href="<?php echo(SITE_URL); ?>view/<?php echo((int)DB::real_escape_string($_GET['pid'])); ?>" >去看看</a></div>
		</div>
	</div>
</div>	
<!--内容说明-->
<div class="soft_info clearfix">
	<div class="wrap_con">
		<!--左侧内容-->
	  <div class="slider_left">
			<div class="title"><h2>软件内容</h2></div>
				<div class="funs">

				</div>
			<div class="inner">
			<div class="qr_code">
				<span>
<?php
$package_id = (int)DB::real_escape_string($_GET['pid']);
?>
				<img src="/qrcode/api.php?data=http:<?php echo(SITE_URL); ?>view/<?php echo((int)DB::real_escape_string($_GET['pid'])); ?>"  height="132" width="132" alt="二维码扫描下载" />
                <span class="prompt">扫描二维码下载</span>

				</span>
				<div class="hint" id="hint">
					<span>请确保到
						<a href="javascript:;">添加<?php echo(AUTOFILL_SEO); ?><span class="pop_up"><i></i><img src="<?php echo(SITE_URL); ?>ziyuan/picture/addleifengsource.png"  alt="添加教程图片" /> </span> </a>
						<a href="javascript:;">刷新列表 <span class="pop_up pack_pop_up"><i></i><img src="<?php echo(SITE_URL); ?>ziyuan/picture/packages_cit.jpg" height="100" width="388" alt="刷新教程图片" /></span></a>以后再<br>扫描二维码下载
					</span>
					<em></em>
				</div>	
			</div>
                <span><font size="4"><b>软件描述：</b></font></span><br><font size="3"><?php echo($package_info['Description']); ?></font>
              <br><br>
				<span><font size="4"><b>软件简介：</b></font></span><br><font size="3"><?php echo($package_info['Multi']); ?></font>
				<br><br>
				<span><font size="4"><b>更新说明：</b></font></span><br><font size="3"><?php echo($package_info['Changelog']); ?></font>				
			</div>
			<!--截图-->
			<div class="screenshot">
			<div class="label"><h4>屏幕截图</h4></div>
			<div class='img-container'>
			<div class="pic_list">
			<ul>
		


<?php
$package_id = (int)DB::real_escape_string($_GET['pid']);
$screenshots_query = DB::result_first("SELECT `ScreenShots` FROM `".DCRM_CON_PREFIX."Packages` WHERE `ID` = '".$package_id."'");
$screenshots = maybe_unserialize($screenshots_query);   
if (empty($screenshots)) {
			$screenshots_count = count($screenshots);
?>
		<li><img src="<?php echo(SITE_URL); ?>ziyuan/picture/zw.png" alt="预览图片" /></li>
<?php
			}
?>              
<?php
			foreach ($screenshots as $screenshot) {
?>	              
		<li><img src="<?php echo($screenshot); ?>" alt="预览图片" /></li>
<?php
			}
?>

		</ul>
		</div>
		</div>
		</div>
        
		<br>
		
</div>
<div class="slider_right">		
  <div class="search_box">
				<form action="<?php echo(SITE_URL); ?>search.php" method="get" >	
					<span class="txt">
						<input class="input" type="text" name="name"  placeholder="搜索你想要的" required="required" />
					</span>
					<span class="btn"><button type="submit" id="search_btn"><i></i>搜索</button></span>
				</form>
		</div>
  
<div class="wa_d284">
        <div id="set" class="gg m_hide">
            <div class="swiper-container swiper-container-horizontal">
                <ul class="swiper-wrapper">
                    <li class="swiper-slide swiper-slide-duplicate swiper-slide-next swiper-slide-duplicate-prev" data-swiper-slide-index="0">
                        <a href="<?php echo(AUTOFILL_YLYPCGGW1); ?>" target="_blank"><img src="<?php echo(SITE_URL); ?>icon/ylyggw1.png" alt="" height="284" width="284"></a>
                    </li>
                    <li class="swiper-slide swiper-slide-duplicate-active swiper-slide-prev swiper-slide-duplicate-next" data-swiper-slide-index="0">
                        <a href="<?php echo(AUTOFILL_YLYPCGGW2); ?>" target="_blank"><img src="<?php echo(SITE_URL); ?>icon/ylyggw2.png" alt="" height="284" width="284"></a>
                    </li>
                    <li class="swiper-slide swiper-slide-duplicate swiper-slide-active swiper-slide-duplicate-prev" data-swiper-slide-index="0">
                        <a href="<?php echo(AUTOFILL_YLYPCGGW3); ?>" target="_blank"><img src="<?php echo(SITE_URL); ?>icon/ylyggw3.png" alt="" height="284" width="284"></a>
                    </li>
					</ul>
            </div>
        </div> 
</div>
<script>
    var mySwiper = new Swiper ('.swiper-container', {
        slidesPerView : 'auto',
        autoplay : 3000,
        direction: 'horizontal',
        loop: true,
        pagination: '.swiper-pagination',
        paginationClickable: true
    })
</script> 
  
</div> 
</div>
</div>
</div>
        
<div class="recommend clearfix">
	<div class="wrap_con">
		<div class="title">源主推荐</div>
		<div class="fantastic_soft">
				<ul> 			

<?php
				$packages = DB::fetch_all("SELECT `ID`, `DownloadTimes`, `Tjreason`,`PushStar`, `Name`,`Description`, `Icon2`,`Section`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Recommend` = '1') ORDER BY `CreateStamp` DESC limit 0,8"  );
				foreach($packages as $package) {
?>               
          
				   <li>
					<a href="<?php echo_rewrite_url('public', $package['ID']);?>" target="_blank" class="thumbnail">
						<img  src="<?php echo(SITE_URL); ?>icon/<?php echo(empty($package['Icon2']) ? 'default/unknown.png' : $package['Icon2']); ?>"  height="118" width="118">
						<i></i>
						<em class="add"></em>
					</a>
                   <p class="soft_name"><a href="<?php echo_rewrite_url('public', $package['ID']);?>"target="_blank" title="<?php echo($package['Name']); ?>"><?php echo($package['Name']); ?></a></p>
					<div class="star_s"><span style="width:<?php echo($package['PushStar']); ?>%;"></span></div>
					<p class="bottom_cit"><a href="<?php echo_rewrite_url('public', $package['ID']);?>" target="_blank"><?php echo($package['Tjreason']); ?></a></p>
                     </li>

<?php	
   } 
?>           
			</ul>         
    </div>
  </div>
</div>        
        
   <?php
$time = strtotime($package_info['CreateStamp']);
$time2 = strtotime($package_info['CreateStamp']);
?>      
<link rel="canonical" href="<?php echo(SITE_URL); ?>public/<?php echo((int)DB::real_escape_string($_GET['pid'])); ?>">
<script src="//msite.baidu.com/sdk/c.js?appid=1617032924050561"></script>
    <!--图片推送-->
        <script type="application/ld+json">
        {
            "@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
            "@id": "https:<?php echo(SITE_URL); ?>public/<?php echo((int)DB::real_escape_string($_GET['pid'])); ?>",
            "appid": "1617032924050561",
            "title": "<?php echo($package_info['Name']); ?>",
            "images": [ "https:<?php echo(SITE_URL); ?>icon/<?php echo($section_icon); ?>"],
            "description": "<?php echo($package_info['Multi']); ?>",
            "pubDate": "<?php echo (date("Y-m-d", $time)); ?>T<?php echo (date("H:i:s", $time2)); ?>",
            "upDate": "<?php echo (date("Y-m-d", $time)); ?>T<?php echo (date("H:i:s", $time2)); ?>"
        }
    </script> 
 <?php
		}}}}
?>  
           <?php
  /*   当前页面推送   
$url = "http://mycydia.vip/public/".(int)DB::real_escape_string($_GET['pid'])."";
$urls = array($url);        
$api = 'http://data.zz.baidu.com/urls?appid=1617032924050561&token=w58MAEcJ3X1liKQO&type=realtime';
$ch = curl_init();
$options =  array(
    CURLOPT_URL => $api,
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => implode("\n", $urls),
    CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
//echo $result;  
*/
        ?> 
    <!-- footer -->
    <!--随便看看-->
<?php     
    if (defined("AUTOFILL_QXWZMC1") or defined("AUTOFILL_QXWZDZ1") or defined("AUTOFILL_QXWZMC2") or defined("AUTOFILL_QXWZDZ2") or defined("AUTOFILL_QXWZMC3") or defined("AUTOFILL_QXWZDZ3")) {
?>    
    <div class="footer">
      <div class="wrap_con">
        <h3>旗下网站</h3>
        <div class="footer_nav">
<?php
    }       
    if (defined("AUTOFILL_QXWZMC1") && defined("AUTOFILL_QXWZDZ1")) {
?>  
			<a href="<?php echo(AUTOFILL_QXWZDZ1); ?>" target="_blank"><?php echo(AUTOFILL_QXWZMC1); ?></a>
			|
<?php
    }                                                                     
    if (defined("AUTOFILL_QXWZMC2") && defined("AUTOFILL_QXWZDZ2")) {
?>            
			<a href="<?php echo(AUTOFILL_QXWZDZ2); ?>" target="_blank"><?php echo(AUTOFILL_QXWZMC2); ?></a>
			|
<?php
    }                                                                     
    if (defined("AUTOFILL_QXWZMC3") && defined("AUTOFILL_QXWZDZ3")) {
?>            
			<a class="hint-new" href="<?php echo(AUTOFILL_QXWZDZ3); ?>" target="_blank"><?php echo(AUTOFILL_QXWZMC3); ?></a>
		</div>
       
		<p><a href="http://www.miitbeian.gov.cn/" target="_blank">
          <?php if(defined("AUTOFILL_FOOTER_CODE")){ ?>
					<?php echo(stripslashes(AUTOFILL_FOOTER_CODE));?> </a></p>
		  <?php } ?>        
		<p><a  style="color: #c0392b;" >Copyright <?php printf( __( 'Copyright &copy; %s' ) , defined("AUTOFILL_FOOTER_YEAR") ? htmlspecialchars(stripslashes(AUTOFILL_FOOTER_YEAR)).'-'.date("Y") : date("Y") ); ?>  http:<?php echo(SITE_URL); ?> ®. All rights reserved. <?php echo(AUTOFILL_SEO); ?>版权或产权保护</a></p>
	</div>
    </div>
<?php
    }                                                                     
?>
        
<div class="bottom_fix">
<!--返回顶部-->
<a href="javascript:;" class="go_top" id="go_top_btn">返回顶部</a>
</div>
   <?php
	if (defined("AUTOFILL_BAIDUTJ")) {
?>
<?php echo(AUTOFILL_BAIDUTJ); ?>
  <?php
	}
?> 
<script type="text/javascript" src="<?php echo(SITE_URL); ?>ziyuan/js/jquery-1.7.min.js" ></script>
<script type="text/javascript" src="<?php echo(SITE_URL); ?>ziyuan/js/common.js"></script>
<script>
        PostbirdImgGlass.init({
            domSelector:".img-container img",
            animation:true
        });
</script>
<script type="text/javascript" >
//global options
var STATIC_URL = '<?php echo(SITE_URL); ?>';
$.ajaxSetup({ cache:true });
ds.Dialog.defaults.iconBasePath = 'ziyuan/images/';

//Navigator autoFixed
$.getScript(STATIC_URL + 'ziyuan/js/jquery.autoFixed.js', function(){
	$('#header').autoFixed();
});

//返回顶部
jQuery(function($){
	var timer, view = $(window), btn = $('#go_top_btn');

	function scrollHandler(){
		clearTimeout(timer);
		timer = setTimeout(checkScroll, 160);
	}
	function checkScroll(){
		var top = view.scrollTop();
		btn[top > 100 ? 'removeClass' : 'addClass']('hide');
	}

	btn.bind('click', function(){
		btn.addClass('hide');
		ds.scrollTo(0);
	});
	view.bind('scroll', scrollHandler);
	scrollHandler();
});
</script>	
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<script>(function(){
var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ac2ed4c8111f69164c6315f8f19a50da":"https://jspassport.ssl.qhimg.com/11.0.1.js?ac2ed4c8111f69164c6315f8f19a50da";
document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script> 		
	</body>
</html>
